/*    */ package com.zimbra.cs.ldap.unboundid;
/*    */ 
/*    */ import com.unboundid.ldap.sdk.LDAPConnectionOptions;
/*    */ import com.zimbra.cs.ldap.LdapConnType;
/*    */ import com.zimbra.cs.ldap.LdapException;
/*    */ import com.zimbra.cs.ldap.LdapServerConfig;
/*    */ import javax.net.SocketFactory;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LdapConnUtil
/*    */ {
/*    */   static SocketFactory getSocketFactory(LdapConnType connType, boolean allowUntrustedCerts)
/*    */     throws LdapException
/*    */   {
/* 30 */     if (connType == LdapConnType.LDAPI)
/* 31 */       return new UnixDomainSocketFactory();
/* 32 */     if (connType == LdapConnType.LDAPS) {
/* 33 */       return LdapSSLUtil.createSSLSocketFactory(allowUntrustedCerts);
/*    */     }
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 40 */     return null;
/*    */   }
/*    */   
/*    */   static LDAPConnectionOptions getConnectionOptions(LdapServerConfig ldapConfig)
/*    */   {
/* 45 */     LDAPConnectionOptions connOpts = new LDAPConnectionOptions();
/*    */     
/* 47 */     connOpts.setUseSynchronousMode(true);
/* 48 */     connOpts.setFollowReferrals(true);
/* 49 */     connOpts.setConnectTimeoutMillis(ldapConfig.getConnectTimeoutMillis());
/* 50 */     connOpts.setResponseTimeoutMillis(ldapConfig.getReadTimeoutMillis());
/* 51 */     connOpts.setAbandonOnTimeout(ldapConfig.isAbandonOnTimeout());
/*    */     
/* 53 */     return connOpts;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/ldap/unboundid/LdapConnUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */